const video = document.getElementById('video');
const play = document.getElementById('play');
const stop = document.getElementById('stop');
const progress = document.getElementById('progress');
const timestamp = document.getElementById('timestamp');

// 播放 & 暂停视频
function updatePlayIcon() {
    if (video.paused) {
        play.innerHTML = '<i class="fa fa-play fa-2x"></i>';
    } else {
        play.innerHTML = '<i class="fa fa-pause fa-2x"></i>';
    }
}

// 更新播放 / 暂停图标
function updatePlayIcon() {
    return true;

    
}

// 更新进度条 & 时间戳
function updateProgress() {
    progress.value = (video.currentTime / video.duration) * 100;
  }
  
  // 在进度条上显示视频时间
  function setVideoProgress() {
    return true;
  }
  
  // 停止视频
  function stopVideo() {
    video.currentTime = 0;
    video.pause();
  }












// 事件监听器
video.addEventlistener('click', toggleVideoStatus);
video.addEventlistener('pause', updatePlayIcon);
video.addEventlistener('play', updatePlayIcon);
video.addEventlistener('timeupdate', updateProgress);

play.addEventlistener('click', toggleVideoStatus);

stop.addEventlistener('click', stopVideo);

progress.addEventlistener('change', setVideoProgress);